<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>伪类选择器 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../CSS/伪对象选择器.html" />
    
    
    <link rel="prev" href="../CSS/元素样式.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.7"
        data-chapter-title="伪类选择器"
        data-filepath="CSS/伪类选择器.md"
        data-basepath=".."
        data-revision="Fri Sep 01 2017 14:19:43 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="html/HTML.html">
            
                
                    <a href="../html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="html/html标签.html">
            
                
                    <a href="../html/html标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        hmtl标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="html/table.html">
            
                
                    <a href="../html/table.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        table
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="html/forms.html">
            
                
                    <a href="../html/forms.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        form
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="html/type.html">
            
                
                    <a href="../html/type.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        type
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="html/实体字符.html">
            
                
                    <a href="../html/实体字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        实体字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="html/图像.html">
            
                
                    <a href="../html/图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="html/icon.iframe.html">
            
                
                    <a href="../html/icon.iframe.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        icon iiframe base
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="html/H5的语义化标签.html">
            
                
                    <a href="../html/H5的语义化标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        H5的语义化标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="html/图片的热区域.html">
            
                
                    <a href="../html/图片的热区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.9.</b>
                        
                        图片热区
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="html/锚点.html">
            
                
                    <a href="../html/锚点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.10.</b>
                        
                        锚点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="html/video.html">
            
                
                    <a href="../html/video.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.11.</b>
                        
                        video
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="html/audio.html">
            
                
                    <a href="../html/audio.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.12.</b>
                        
                        audio
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="CSS/css.html">
            
                
                    <a href="../CSS/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="CSS/CSS选择器.html">
            
                
                    <a href="../CSS/CSS选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="CSS/关系选择器.html">
            
                
                    <a href="../CSS/关系选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        关系选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="CSS/群组选择器.html">
            
                
                    <a href="../CSS/群组选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        群组选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="CSS/通配选择器.html">
            
                
                    <a href="../CSS/通配选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        通配选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="CSS/元素选择器.html">
            
                
                    <a href="../CSS/元素选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="CSS/元素样式.html">
            
                
                    <a href="../CSS/元素样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        元素样式
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.7" data-path="CSS/伪类选择器.html">
            
                
                    <a href="../CSS/伪类选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="CSS/伪对象选择器.html">
            
                
                    <a href="../CSS/伪对象选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        伪对象选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="CSS/属性选择器.html">
            
                
                    <a href="../CSS/属性选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="CSS/font.html">
            
                
                    <a href="../CSS/font.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        字体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="CSS/嵌入字体.html">
            
                
                    <a href="../CSS/嵌入字体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        嵌入字体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="CSS/边框样式.html">
            
                
                    <a href="../CSS/边框样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        边框样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="CSS/内边距.html">
            
                
                    <a href="../CSS/内边距.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        内边距
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="CSS/外边距.html">
            
                
                    <a href="../CSS/外边距.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        外边距
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="CSS/圆角效果.html">
            
                
                    <a href="../CSS/圆角效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        圆角效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="CSS/透明度.html">
            
                
                    <a href="../CSS/透明度.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        透明度
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="CSS/段落控制.html">
            
                
                    <a href="../CSS/段落控制.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        段落控制
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.18" data-path="CSS/三角形.html">
            
                
                    <a href="../CSS/三角形.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.18.</b>
                        
                        三角形
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.19" data-path="dingwei/绝对定位.html">
            
                
                    <a href="../dingwei/绝对定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.19.</b>
                        
                        绝对定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.20" data-path="dingwei/相对定位.html">
            
                
                    <a href="../dingwei/相对定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.20.</b>
                        
                        相对定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.21" data-path="dingwei/固定定位.html">
            
                
                    <a href="../dingwei/固定定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.21.</b>
                        
                        固定定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.22" data-path="CSS/mediatype.html">
            
                
                    <a href="../CSS/mediatype.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.22.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;">&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;</h2>
<p>&#x4ECB;&#x7ECD;&#xFF1A;&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x5176;&#x5B9E;&#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x72B6;&#x6001;</p>
<h3 id="link&#x9009;&#x62E9;&#x5668;">link&#x9009;&#x62E9;&#x5668;</h3>
<blockquote>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x8BBE;&#x7F6E;&#x8D85;&#x94FE;&#x63A5;a&#x672A;&#x88AB;&#x8BBF;&#x95EE;&#x65F6;&#x5019;&#x989C;&#x8272;&#x7684;&#x5143;&#x7D20;<br>&#x8BBE;&#x7F6E;&#x989C;&#x8272;&#x53D8;&#x6210;&#x9ED1;&#x8272;&#x7684;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-css">       <span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">link{
            color: black</span></span>;
            }
</code></pre>
</blockquote>
<h3 id="visited">visited</h3>
<blockquote>
<p>&#x8FD9;&#x4E2A;&#x662F;&#x8BBE;&#x7F6E;a&#x8FDE;&#x63A5;&#x88AB;&#x4F7F;&#x7528;&#x8FC7;&#x540E;&#x7684;&#x989C;&#x8272;</p>
<pre><code class="lang-csss">a:visited{
        color: deepskyblue;
}
</code></pre>
</blockquote>
<h3 id="hover&#x9009;&#x62E9;&#x5668;">hover&#x9009;&#x62E9;&#x5668;</h3>
<blockquote>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x5F53;&#x9F20;&#x6807;&#x8986;&#x76D6;a&#x6807;&#x7B7E;&#x65F6;&#x5019;&#x7684;&#x989C;&#x8272;<br>&#x53EF;&#x4EE5;&#x8D4B;&#x4E88;&#x4EFB;&#x4F55;&#x6807;&#x7B7E;&#x4F7F;&#x7528;<br>&#x8BBE;&#x7F6E;&#x989C;&#x8272;&#x7684;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">hover{
        color: red</span></span>;
}
</code></pre>
</blockquote>
<h3 id="active&#x9009;&#x62E9;&#x5668;">active&#x9009;&#x62E9;&#x5668;</h3>
<blockquote>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x5F53;a&#x8FDE;&#x63A5;&#x88AB;&#x70B9;&#x51FB;&#x4E2D;&#x7684;&#x65F6;&#x5019;&#x7684;&#x989C;&#x8272;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">active{
    color: yellowgreen</span></span>;
}
</code></pre>
<p><strong>&#x4E0A;&#x9762;&#x7684;&#x8BBE;&#x7F6E;a&#x6807;&#x7B7E;&#x7684;&#x9009;&#x62E9;&#x5668;&#x8981;&#x6709;&#x987A;&#x5E8F;&#x5C31;&#x662F;&#x5148;link&#x3001;&#x7136;&#x540E;visited&#xFF0C;&#x7136;&#x540E;hover&#xFF0C;&#x7136;&#x540E;active&#x3002;</strong></p>
</blockquote>
<h4 id="focus&#x9009;&#x62E9;&#x5668;">focus&#x9009;&#x62E9;&#x5668;</h4>
<blockquote>
<p>&#x8FD9;&#x662F;&#x5F53;text&#x83B7;&#x53D6;&#x7126;&#x70B9;&#x65F6;&#x7684;&#x72B6;&#x6001;  </p>
</blockquote>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">.input</span>:<span class="hljs-value">focus{
        color: skyblue</span></span>;
}
</code></pre>
<h4 id="nthchild">nth-child</h4>
<blockquote>
<p>&#x8FD9;&#x662F;&#x5339;&#x914D;&#x7236;&#x5143;&#x7D20;&#x7684;&#x7B2C;n&#x4E2A;&#x5B50;&#x5143;&#x7D20;<br>()&#x662F;&#x8981;&#x8F93;&#x5165;&#x7B2C;&#x51E0;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x8F93;&#x5165;&#x5C31;&#x662F;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x3002;<br>&#x53EF;&#x4EE5;&#x8F93;&#x5165;odd&#x7B49;&#x4E8E;&#x5947;&#x6570;&#x7684;&#xFF0C;even&#x7B49;&#x4E8E;&#x5076;&#x6570;&#x7684;<br><strong>&#x5B50;&#x5143;&#x7D20;&#x7CFB;&#x5217;&#xFF0C;&#x90FD;&#x662F;&#x901A;&#x8FC7;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x4F4D;&#x7F6E;&#x6765;&#x63A7;&#x5236;&#x5BF9;&#x5E94;&#x7684;&#x5B50;&#x5143;&#x7D20;&#xFF08;&#x4E0D;&#x533A;&#x5206;&#x7C7B;&#x578B;&#xFF09;</strong><br>&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-css"><span class="hljs-tag">ul</span>&gt;<span class="hljs-rule"><span class="hljs-attribute">li</span>:<span class="hljs-value"><span class="hljs-function">nth-child</span>(){
        background-color: pink</span></span>;
}
</code></pre>
</blockquote>
<h4 id="nthoftype">nth-of-type</h4>
<blockquote>
<p>&#x63A7;&#x5236;ul&#x4E0B;&#x9762;&#x7684;&#x67D0;&#x4E2A;&#x7C7B;&#x578B;&#x5143;&#x7D20;<br>( )&#x53EF;&#x4EE5;&#x586B;&#x5199;even&#x5F53;&#x505A;&#x662F;&#x5076;&#x6570;&#xFF0C;odd&#x662F;&#x5F53;&#x505A;&#x5947;&#x6570;  </p>
</blockquote>
<pre><code class="lang-css"><span class="hljs-tag">ul</span>&gt;<span class="hljs-rule"><span class="hljs-attribute">div</span>:<span class="hljs-value"><span class="hljs-function">nth-of-type</span>(){
        color: green</span></span>;
 }
</code></pre>
<h4 id="not">not()</h4>
<blockquote>
<p>&#x8FD9;&#x4E2A;&#x53EF;&#x4EE5;&#x63A7;&#x5236;&#x975E;&#x62EC;&#x53F7;&#x91CC;&#x9762;&#x6240;&#x8BBE;&#x5B9A;&#x7684;&#x5143;&#x7D20;&#x5916;&#x7684;&#x5176;&#x4ED6;&#x5143;&#x7D20;&#x7684;&#x5C5E;&#x6027;<br>&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-css"> <span class="hljs-tag">ul</span>&gt;<span class="hljs-pseudo">:not(li)</span><span class="hljs-rules">{
        <span class="hljs-rule"><span class="hljs-attribute">font-size</span>:<span class="hljs-value"> <span class="hljs-number">30px</span></span></span>;
 }</span>
</code></pre>
</blockquote>
<h4 id="placeholder">placeholder</h4>
<blockquote>
<p>&#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x6587;&#x5B57;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x6837;&#x5F0F;&#x3002;
&#x5C31;&#x662F;&#x8BBE;&#x7F6E;&#x6587;&#x672C;&#x6846;&#x5185;&#x63D0;&#x793A;&#x5B57;&#x7684;&#x989C;&#x8272;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">input</span>:<span class="hljs-value">placeholder{
       color:red</span></span>;
}
</code></pre>
</blockquote>
<h4 id="empty">empty</h4>
<blockquote>
<p>&#x8BBE;&#x7F6E;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x5B50;&#x5143;&#x7D20;&#xFF08;&#x5305;&#x62EC;text&#x8282;&#x70B9;&#xFF09;&#x7684;&#x5143;&#x7D20;&#x3002;<br>&#x662F;&#x7528;&#x6765;&#x8BBE;&#x7F6E;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x5B50;&#x5143;&#x7D20;&#xFF0C;&#x5E76;&#x4E14;&#x5143;&#x7D20;&#x91CC;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x5185;&#x5BB9;&#x7684;&#x9009;&#x62E9;&#x5668;&#x3002;<br>&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">p</span>:<span class="hljs-value">empty {
    height: <span class="hljs-number">25px</span></span></span>;
    <span class="hljs-rule"><span class="hljs-attribute">border</span>:<span class="hljs-value"> <span class="hljs-number">1px</span> solid <span class="hljs-hexcolor">#ddd</span></span></span>;
    <span class="hljs-rule"><span class="hljs-attribute">background</span>:<span class="hljs-value"> <span class="hljs-hexcolor">#eee</span></span></span>;
}
</code></pre>
</blockquote>
<p> <strong>&#x8FD9;&#x4E2A;&#x662F;&#x8BBE;&#x7F6E;p&#x6807;&#x7B7E;&#x6CA1;&#x5185;&#x5BB9;&#x65F6;&#x5019;&#x663E;&#x793A;&#x7684;&#x989C;&#x8272;</strong></p>
<h4 id="checked">checked</h4>
<blockquote>
<p>&#x4F5C;&#x7528;&#x4E0E;&#x7528;&#x6237;&#x754C;&#x9762;&#x4E0A;&#x5904;&#x4E8E;&#x9009;&#x4E2D;&#x72B6;&#x6001;&#x7684;&#x5143;&#x7D20;(&#x4F5C;&#x7528;&#x4E0E;radio&#x548C;CheckBox)<br>&#x4F5C;&#x7528;&#x4E0E;&#x70B9;&#x51FB;&#x590D;&#x9009;&#x6846;&#x540E;&#xFF0C;&#x5B57;&#x4F53;&#x90A3;&#x90E8;&#x5206;&#x7684;&#x80CC;&#x666F;&#x4F1A;&#x53D8;&#x6210;&#x7EA2;&#x8272;&#x3002;
&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">input</span>:<span class="hljs-value">checked + span {
    background: <span class="hljs-hexcolor">#f00</span></span></span>;
}
</code></pre>
<h4 id="target">target</h4>
<p> &#x6307;&#x5411;&#x6587;&#x6863;&#x5185;&#x67D0;&#x4E2A;&#x5177;&#x4F53;&#x7684;&#x5143;&#x7D20;&#x3002;&#x8FD9;&#x4E2A;&#x88AB;&#x94FE;&#x63A5;&#x7684;&#x5143;&#x7D20;&#x5C31;&#x662F;&#x76EE;&#x6807;&#x5143;&#x7D20;</p>
</blockquote>
<pre><code class="lang-css">#demo:target{color:#f00;}

&lt;div id=&quot;demo&quot;&gt;
    &lt;p&gt;E:target&#x4F2A;&#x7C7B;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;&lt;/p&gt;
&lt;/div&gt;
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../CSS/元素样式.html" class="navigation navigation-prev " aria-label="Previous page: 元素样式"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../CSS/伪对象选择器.html" class="navigation navigation-next " aria-label="Next page: 伪对象选择器"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
